package com.lyb.services.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.lyb.mapper.PermissionMapper;
import com.lyb.pojo.Permission;
import com.lyb.services.PermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class PermissionServiceImpl implements PermissionService {
    @Autowired
    PermissionMapper permissionMapper;
    @Override
    public PageInfo<Permission> queryPage(Integer pageSize, Integer pageNum) {
        PageHelper.startPage(pageNum,pageSize);
        List<Permission> res = permissionMapper.queryPage();
        PageInfo<Permission> pres = new PageInfo<>(res);
        return pres;
    }

    @Override
    public Boolean del(Long id) {
        return permissionMapper.del(id);
    }

    @Override
    public Boolean update(Permission permission) {
        return permissionMapper.update(permission);
    }

    @Override
    public Boolean add(Permission permission) {
        return permissionMapper.add(permission);
    }
}
